/**
 * Created by GYL on 2018/7/25
 */
import React, { Component } from 'react';
import MyModal from '../../../../components/common/MyModal';
import { Form, Row, Col, Input, message, Checkbox, DatePicker } from 'antd';
import moment from 'moment';
import config from "../../../../config";
import style from "./CheckModal.less";
const ming = require("../../../../assets/ming.png")
const FormItem = Form.Item;

class checkModal extends Component {
    state = {

    };
    componentDidMount() {
        let t = this;
    };
    // modal保存
    onModalSave = () => {
        this.props.form.validateFieldsAndScroll((err, val) => {
            if (!err) {
                this.props.onModalSave(val, this.props.type)
            }
        });
    };
    // 筛选条件组件change事件
    getChangeValue(value, e) {
        let t = this;
        let params = {};
        params[value] = e.target.value;
        t.setState({ params });
    }
    onCheckbox(value, e) {
        let t = this;
        let params = {};
        params[value] = e.target.value;
        t.setState({ params });
    }
    render() {
        let t = this;
        let { getFieldDecorator } = t.props.form;
        let arr = this.props.moddleArr;

        return (
            <div>
                <MyModal
                    {...t.props}

                    width={1000}
                    onModalSave={t.onModalSave}>
                    <Form>
                        <Row gutter={48} style={{ boxShadow: "rgba(136, 136, 136, 0.14) 1px 1px 1px 1px",height:430 }}>
                        <Col span={24}></Col>

                            <Col span={24}><h2 style={{textAlign:"center",fontSize:22,position:"relative"}}>武汉金宏燃气有限#1燃气站供应点用户安全检查表</h2></Col>

                            <Col span={24}>
                                <Col span={8}></Col>
                                <Col span={8} style={{fontSize:18}}>{this.props.data?moment(this.props.data.takeTime).format("YYYY年MM月DD日"):""}</Col>
                                <Col span={8} style={{fontSize:18}}>NO.<span style={{color:"red"}}>{this.props.data?this.props.data.reportNumber:""}</span></Col>
                            </Col>
                            <div style={{position:"absolute",width:72,right:"-16px",top:"75px"}}>
                                第一联 ： 站点存根︵
白
︶
                            </div>
                            <table className={style.table_box}>
                                <tr>
                                    <td colSpan="1" style={{ width: "7%" }}>用户姓名</td>
                                    <td colSpan="3" style={{ width: "35%" }}>{this.props.data?this.props.data.userName:""}</td>
                                    <td colSpan="2" style={{ width: "15%" }}>联系电话</td>
                                    <td colSpan="4" style={{ width: "35%" }}>{this.props.data?this.props.data.userPhone:""}</td>
                                </tr>
                                <tr>
                                    <td colSpan="1" style={{ width: "10%" }}>用户地址</td>
                                    <td colSpan="9">{this.props.data?this.props.data.userSite:""}</td>
                                </tr>

                                 <tr>
                                    <td colSpan="2" style={{ width: "15%" }}>检查项目</td>
                                    <td colSpan="2" style={{ width: "15%" }}>检查结果</td>
                                    <td colSpan="2" style={{ width: "15%" }}>检查项目</td>
                                    <td colSpan="2" style={{ width: "15%" }}>检查结果</td>
                                </tr>
                                <tr>
                                    <td rowSpan="2"  >钢瓶状况</td>
                                    <td >是否漏气</td>
                                    <td  colSpan="2" style={{ width: "15%" }}><Checkbox disabled={true} checked={(this.props.data?this.props.data.cylinderAirLeakage:0)}>是 </Checkbox>  <Checkbox checked={!(this.props.data?this.props.data.cylinderAirLeakage:0)} disabled={true}>否 </Checkbox></td>
                                    <td rowSpan="5" style={{ width: "1%" }}>胶管状况</td>
                                    <td style={{ width: "15%" }}>是否合格</td>
                                    <td style={{ width: "15%" }}><Checkbox disabled={true} checked={(this.props.data?this.props.data.qualified:0)}>是 </Checkbox>  <Checkbox disabled={true} checked={!(this.props.data?this.props.data.qualified:0)}>否 </Checkbox></td>
                                </tr>

                                 <tr>
                                    {/* <td rowSpan="2" style={{ width: "10%" }}>钢瓶状况</td> */}
                                    <td >是否超期</td>
                                    <td  colSpan="2" style={{ width: "10%" }}><Checkbox disabled={true} checked={(this.props.data?this.props.data.cylinderBeyondTime:0)}>是 </Checkbox>  <Checkbox disabled={true} checked={!(this.props.data?this.props.data.cylinderBeyondTime:0)}>否 </Checkbox></td>
                                    {/* <td rowSpan="5" style={{ width: "5%" }}>胶管状况</td> */}
                                    <td style={{ width: "15%" }}>是否老化龟裂</td>
                                    <td style={{ width: "15%" }}><Checkbox disabled={true} checked={(this.props.data?this.props.data.chap:0)}>是 </Checkbox>  <Checkbox disabled={true} checked={!(this.props.data?this.props.data.chap:0)}>否 </Checkbox></td>
                                </tr>

                                 <tr>
                                    <td colSpan="2" style={{ width: "10%" }}>燃气灶具是否有熄火保护装置</td>
                                    <td colSpan="2" style={{ width: "10%" }}><Checkbox disabled={true} checked={(this.props.data?this.props.data.protector:0)}>是 </Checkbox>  <Checkbox disabled={true} checked={!(this.props.data?this.props.data.protector:0)}>否 </Checkbox></td>
                                    <td  style={{ width: "10%" }}>是否漏气</td>
                                   
                                    <td colSpan="2" style={{ width: "15%" }}><Checkbox disabled={true} checked={(this.props.data?this.props.data.cylinderAirLeakage:0)}>是 </Checkbox>  <Checkbox disabled={true} checked={!(this.props.data?this.props.data.cylinderAirLeakage:0)}>否 </Checkbox></td>
                                </tr>

                                <tr>
                                    <td colSpan="2" style={{ width: "10%" }}>是否使用可调减压阀</td>
                                    <td colSpan="2" style={{ width: "10%" }}><Checkbox disabled={true} checked={(this.props.data?this.props.data.reducingValve:0)}>是 </Checkbox>  <Checkbox checked={!(this.props.data?this.props.data.reducingValve:0)} disabled={true}>否 </Checkbox></td>
                                    <td  style={{ width: "10%" }}>是否超过2米</td>
                                   
                                    <td colSpan="2" style={{ width: "15%" }}><Checkbox disabled={true} checked={(this.props.data?this.props.data.sebificDuctBeyondNum:0)}>是 </Checkbox>  <Checkbox checked={!(this.props.data?this.props.data.sebificDuctBeyondNum:0)} disabled={true}>否 </Checkbox></td>
                                </tr>

                                <tr>
                                    <td colSpan="2" style={{ width: "10%" }}>用气环境是否通风</td>
                                    <td colSpan="2" style={{ width: "10%" }}><Checkbox disabled={true} checked={(this.props.data?this.props.data.ventilate:0)}>是 </Checkbox>  <Checkbox checked={!(this.props.data?this.props.data.ventilate:0)} disabled={true}>否 </Checkbox></td>
                                    <td  style={{ width: "10%" }}>接头是否安装卡箍</td>
                                   
                                    <td colSpan="2" style={{ width: "15%" }}><Checkbox disabled={true} checked={(this.props.data?this.props.data.lathedog:0)}>是 </Checkbox>  <Checkbox checked={!(this.props.data?this.props.data.lathedog:0)} disabled={true}>否 </Checkbox></td>
                                </tr>

                            </table>
                            <Col span={24}><br/></Col>
                            <Col span={12} style={{textAlign:'center',lineHeight:2.5,height:35}}>检查人 : {this.props.data?this.props.data.assessor:""}</Col>  <Col span={12} style={{textAlign:"center"}}>用户签名 : <img src ={ming} style={{width:70,height:35}}/></Col>


                   

                        </Row>

                    </Form>
                </MyModal>
            </div>
        )
    }
}
export default Form.create()(checkModal);
